package com.abel.order.state.enums;

import com.abel.order.state.entity.Order;

public enum OrderStateEnum {

    // 未支付
    UNPAY {
        @Override
        public void nextState(Order state) {
            state.setOrderStateEnum(PAY);
        }
    },
    // 已支付
    PAY {
        @Override
        public void nextState(Order state) {
            state.setOrderStateEnum(FINISHED);
        }
    },
    // 已完成
    FINISHED {
        @Override
        public void nextState(Order state) {
            state.setOrderStateEnum(PAY);
        }
    };

    public abstract  void nextState(Order state);

}
